﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using WL_Store.DAL;
using WL_Store.Model;

namespace WL_Store.BLL
{
   public  class RefundBLL
    {
        protected RefundDAL dal = new RefundDAL();
        /// <summary>
        /// 查询所有退款信息或根据检索的信息查找信息
        /// </summary>
        /// <returns></returns>
        public List<RefundModel> GetRefunds(RefundSearchModel searchModel)
        {
            return dal.GetRefunds(searchModel);
        }
        /// <summary>
        /// 查询商品类别
        /// </summary>
        /// <returns></returns>
        public DataTable GetGoodsType()
        {
            return dal.GetGoodsType();
        }

        /// <summary>
        /// 软删除退款信息 如果返回true：删除成功；返回false删除失败
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        public bool DeleteRefund(string orderID)
        {
            return dal.DeleteRefund(orderID);
        }

        /// <summary>
        /// 添加退款信息 返回true：添加成功；返回false：添加失败
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddRefund(RefundModel model)
        {
            return dal.AddRefund(model);
        }

        /// <summary>
        /// 根据订单编号查询退款信息
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        public RefundModel GetRefund(string orderID)
        {
            return dal.GetRefund(orderID);
        }

        /// <summary>
        /// 根据订单编号更改信息
        /// </summary>
        /// <param name="orderID"></param>
        /// <returns></returns>
        public bool UpdateRefund(RefundModel model)
        {
            return dal.UpdateRefund(model);
        }
    }
}
